From b487ed554d9dd7c0022490b870d281a1a5e517b2 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Wed, 27 Jun 2007 20:00:53 +0000 Subject: [PATCH] Fixed, very hackishly, a one pixel error that occurs using the XP theme 2007-06-27 Cody Russell * modules/engines/ms-windows/msw_style.c (draw_themed_tab_button): Fixed, very hackishly, a one pixel error that occurs using the XP theme engine only on the left-most tab, if it is active, when the notebook is bottom-oriented. (#392283) svn path=/trunk/; revision=18264 --- ChangeLog | 7 +++++++ modules/engines/ms-windows/msw_style.c | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8be910272c..d31f1d9326 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-06-27 Cody Russell + + * modules/engines/ms-windows/msw_style.c (draw_themed_tab_button): + Fixed, very hackishly, a one pixel error that occurs using the + XP theme engine only on the left-most tab, if it is active, when + the notebook is bottom-oriented. (#392283) + 2007-06-27 Johan Dahlin * tests/buildertest.c: (test_value_from_string): diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index b2d92b67a0..87ac6a4127 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -2552,6 +2552,25 @@ draw_themed_tab_button (GtkStyle *style, g_object_unref (pixbuf); pixbuf = rotated; + // XXX - This is really hacky and evil. When we're drawing the left-most tab + // while it is active on a bottom-oriented notebook, there is one white + // pixel at the top. There may be a better solution than this if someone + // has time to discover it. + if (gap_side == GTK_POS_BOTTOM && state_type == GTK_STATE_NORMAL && x == widget->allocation.x) + { + int rowstride = gdk_pixbuf_get_rowstride (pixbuf); + int n_channels = gdk_pixbuf_get_n_channels (pixbuf); + int psub = 0; + + guchar *pixels = gdk_pixbuf_get_pixels (pixbuf); + guchar *p = pixels + rowstride; + + for (psub = 0; psub < n_channels; psub++) + { + pixels[psub] = p[psub]; + } + } + gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, clip_rect.x, clip_rect.y, clip_rect.width, clip_rect.height, GDK_RGB_DITHER_NONE, 0, 0); g_object_unref (pixbuf); -- 2.30.2